Hi David,
The Zero() function will automatically add the current position to the CommuationOffset after zeroing the Position so the commutation should still work correctly. Just be aware of this so you don't change it back to the original value.
Regarding KFLOP "Threads": Yes they allow what is referred to as pre-emptive multitasking (multiple programs running at the same time). Each Thread consists of an area of memory where a program can be
loaded, A CPU Stack for that program, and a potential time slice of the CPU. See:
http://dynomotion.com/Help/Multitasking.htm
Really the only thing that you need to understand is that two programs that ever need to be running at the same time need to be assigned to different threads. The KFLOP system Thread runs all the time in Thread #0. So Thread #0 may never be used. In a typical KMotionCNC system the Init.c program is usually assigned to thread #1 and
runs forever. If other UserButtons (or MCodes) run C Programs that do something and terminate (Exec/Wait option) then these might all be assigned to use Thread#2. If your programs run for a longer time where a 3rd or 4th program might be Launched so they all overlap in time, then they must all be assigned to different Threads.
All Threads are killed (stop executing) when the Big Red Stop Button is pushed - except for thread #7. So use thread #7 for anything you wish to continue to run after a Stop.
HTH
Regards
TK
Group: DynoMotion |
Message: 6095 |
From: daveymahomh600e |
Date: 11/15/2012 |
Subject: Re: 3PH Brushless, Homing and Limit Question(s) |
Thank you Tom.
This information is very helpful.
David
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> The Zero() function will automatically add the current position to the CommuationOffset after zeroing the Position so the commutation should still work correctly. Just be aware of this so you don't change it back to the original value.
>
>
> Regarding KFLOP "Threads": Yes they allow what is referred to as pre-emptive multitasking (multiple programs running at the same time). Each Thread consists of an area of memory where a program can be loaded, A CPU Stack for that program, and a potential time slice of the CPU. See:
>
> http://dynomotion.com/Help/Multitasking.htm
>
> Really the only thing that you need to understand is that two programs that ever need to be running at the same time need to be assigned to different threads. The KFLOP system Thread runs all the time in Thread #0. So Thread #0 may never be used. In a typical KMotionCNC system the Init.c program is usually assigned to thread #1 and runs forever. If other UserButtons (or MCodes) run C Programs that do something and terminate (Exec/Wait option) then these might all be assigned to use Thread#2. If your programs run for a longer time where a 3rd or 4th program might be Launched so they all overlap in time, then they must all be assigned to different Threads.
>
> All Threads are killed (stop executing) when the Big Red Stop Button is pushed - except for thread #7. So use thread #7 for anything you wish to continue to run after a Stop.
>
>
> HTH
> Regards
> TKÂ
>
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, November 15, 2012 6:04 AM
> Subject: [DynoMotion] 3PH Brushless, Homing and Limit Question(s)
>
>
> Â
> Hi Tom,
>
> I am working on getting my C programs setup to run my 2 axis machine and have a couple of questions.
>
> The HomeBrushless program gets the motors up and zeros their positions. I have this setup in KmotionCNC with a User Button. Next I want to move each axis to define their Home positions using one of the limit switches on each axis. The plan is to slowly move each axis until the limit switch makes and then back off the switch by a defined amount.
>
> In reviewing some sample code for homing, I noticed there is a Zero() statement after the axis moves back off the switch. The KFlop manual documentation for this command says "--for an axis that uses the Position to perform brushless motor commutation, the commutation offset may be required to be adjusted whenever the position measurement is changed." How do I determine what this adjustment would be and how do I apply it?
>
> Also, with regard to the User Buttons in KMotion CNC, how would I determine which thread to use when setting up the buttons? I guess I don't really understand what a thread is.
>
> Thanks in advance,
> David.
>
|
|